package com.youpai.platform.biggod.service.mapper;

import com.youpai.platform.biggod.service.entity.po.SkillPO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @time: 2022/11/12
 * @author: huanghao
 * @description:
 */
@Repository
public interface SkillMapper {

    //新增技能
    public Integer add(SkillPO skillPO);

    //更新技能
    public Integer update(SkillPO skillPO);

    //通过ID获取类别信息
    public SkillPO get(Long skillId);

    //通过用户以及技能获取
    public SkillPO getByUidAndCategory(
            @Param(value = "godUid") Long godUid,
            @Param(value = "categoryId")  Long categoryId);


    //通过名称获取技能信息
    public List<SkillPO> getBySkill(
            @Param(value = "godUid") Long godUid,
            @Param(value = "skill") String skill,
            @Param(value = "offset") Integer offset,
            @Param(value = "length") Integer length);

    public List<SkillPO> list(
            @Param(value = "skillIds") List<Long> skillIds);

    // 数据条数
    public Integer countItem(
            @Param(value = "godUid") Long godUid,
            @Param(value = "skill") String skill);

    //删除技能列表
    public Integer remove(
            @Param(value = "skillIds") List<Long> skillIds);

    //从数据库中物理删除，仅用于测试
    public Integer delete(Long id);
}
